package com.hqyj.controller;


import com.hqyj.pojo.Expenditure;
import com.hqyj.service.IExpenditureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * <p>
 * 支出表 前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-10-21
 */
@RestController
@RequestMapping("/expenditure")
public class ExpenditureController {

    //注入依赖
    @Autowired(required = false)
    IExpenditureService expenditureService;
//    ##################
    @RequestMapping("list")
    HashMap<String,Object> list(Expenditure expenditures){

        return expenditureService.queryList(expenditures);
    }
//################################
    //加载分页页面
    @RequestMapping("/expenditureList")
    public HashMap<String,Object> warehousingList(Expenditure expenditure){
        System.err.println("expenditure:"+expenditure);
        return expenditureService.select(expenditure);
    }

    //删除
    @RequestMapping("/del")
    public HashMap<String ,Object> tuihuoDel(int expenditureId){
        System.out.println("delete:"+expenditureId);
        return expenditureService.del(expenditureId);
    }
}

